
$( document ).ready(function() {
    
    $(".nicescroll").niceScroll({cursorcolor:"#125a87"}); 
    
    var submited=$("input[type='submit']");
    $(submited).hover(
        function(){
            $(this).stop().fadeOut(1);
            $(this).fadeIn(500);
        });
        
    $("input[type='submit']").click(
        function(){
            if($("input[name='rad_nidarticulo']").is(':checked')) 
            {}
            else{
               alertify.alert("No ha seleccionado ningun Articulo");
               return false;
            }
      });
      
jQuery.expr[":"].Contains = jQuery.expr.createPseudo(function(arg) {
    return function( elem ) {
        return jQuery(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
    };
});

    $("input[name='txt_filter']").keyup(function () {
        //split the current value of searchInput
        var data = this.value.split(" ");
        //create a jquery object of the rows
        var jo = $("#article_list").find("tr");
        if (this.value == "") {
            jo.show();
            return;
        }
        //hide all the rows
        jo.hide();
        //Recusively filter the jquery object to get results.
        jo.filter(function (i, v) {
            var $t = $(this);
            for (var d = 0; d < data.length; ++d) {
                    if ($t.is(":Contains('" + data[d] + "')")) {
                    return true;
                    }
                }return false;
       }).show();
     }).focus(function () {
                this.value = "";
                $(this).css({"color": "#fff"});
                $(this).unbind('focus');}).css({"color": "gray"});
});